﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _11._4
{
    public class Animals : DictionaryBase
    {
        public void Add(String NewId, Animal animal) => Dictionary.Add(NewId, animal);

        public void Remove(string id)
        {
            Dictionary.Remove(id);
        }

        public Animals() { }
        public Animal this[string animalID]
        {
            get { return (Animal)Dictionary[animalID]; }
            set { Dictionary[animalID] = value; }
        }

        public new IEnumerator GetEnumerator()
        {
            foreach (object animal in Dictionary.Values)
            {
                yield return animal;
            }
        }
    }
}
